package lab03;

public class Nod {
	private int x;
	private Nod fs; 
	private Nod fd;
	
	public Nod(int x, Nod fs, Nod fd){
		this.x = x;
		this.fs = fs;
		this.fd = fd;
	}//explicit constructor
	
	public int getValue(){
		return this.x;
	}
	
	public void setValue(int x){
		this.x = x;
	}
	
	public String toString(){
		return "x = "+this.x+" fiul stang = "+fs.getValue()+" fiul drept = "+fd.getValue();
	}
	
	public boolean equal(Nod n){
		if (this.x == n.x) return true;
		else return false;
	}
	public void accept(Parcurgere p){
		p.parcurge();
	}
}